package at.tuwien.seminar.scrum1.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.*;

import org.hibernate.annotations.Cascade;

/**
 * Hibernate Room Model
 * 
 * 
 * 
 * @author KimmelF
 * 
 */

@Entity
public class Room implements Serializable {

	/**
	 * Serial ID
	 */
	private static final long serialVersionUID = -8887152880785210538L;

	private long id;
	private String name;
	private int maxNumberOfPersons;
	private double priceSingleRoom;
	private double priceDoubleRoom;
	private double priceTripleRoom;
	private double priceSingleRoomWithChild;
	private double priceSingleRoomWithTwoChild;
	private double priceDoubleRoomWithChild;
	private List<Reservation> reservations = new ArrayList<Reservation>();


	@Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name="ID")
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@OneToMany(mappedBy="room")
	@Cascade({org.hibernate.annotations.CascadeType.REMOVE})
	public List<Reservation> getReservations() {
		return reservations;
	}
	
	public void setReservations(List<Reservation> reservations) {
		this.reservations = reservations;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getMaxNumberOfPersons() {
		return maxNumberOfPersons;
	}

	public void setMaxNumberOfPersons(int maxNumberOfPersons) {
		this.maxNumberOfPersons = maxNumberOfPersons;
	}

	public double getPriceSingleRoom() {
		return priceSingleRoom;
	}

	public void setPriceSingleRoom(double priceSingleRoom) {
		this.priceSingleRoom = priceSingleRoom;
	}

	public double getPriceDoubleRoom() {
		return priceDoubleRoom;
	}

	public void setPriceDoubleRoom(double priceDoubleRoom) {
		this.priceDoubleRoom = priceDoubleRoom;
	}

	public double getPriceTripleRoom() {
		return priceTripleRoom;
	}

	public void setPriceTripleRoom(double priceTripleRoom) {
		this.priceTripleRoom = priceTripleRoom;
	}

	public double getPriceSingleRoomWithChild() {
		return priceSingleRoomWithChild;
	}

	public void setPriceSingleRoomWithChild(double priceSingleRoomWithChild) {
		this.priceSingleRoomWithChild = priceSingleRoomWithChild;
	}

	public double getPriceSingleRoomWithTwoChild() {
		return priceSingleRoomWithTwoChild;
	}

	public void setPriceSingleRoomWithTwoChild(
			double priceSingleRoomWithTwoChild) {
		this.priceSingleRoomWithTwoChild = priceSingleRoomWithTwoChild;
	}

	public double getPriceDoubleRoomWithChild() {
		return priceDoubleRoomWithChild;
	}

	public void setPriceDoubleRoomWithChild(double priceDoubleRoomWithChild) {
		this.priceDoubleRoomWithChild = priceDoubleRoomWithChild;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String toString() {
		return this.getName();
	}

}
